import { Column } from "typeorm";
import { ExtBigIdTuple, ExtIntro, SMALLINT_PG, VARCHAR255_PG, VARCHAR50_PG } from "qqlx-core";

import { TransformerVarchar255, TransformerVarchar50 } from "@lib/orm.transfor.string";
import { TransformerSmallInt } from "@lib/orm.transfor.number";

import { OwnerBigIdSchema } from "@/alpha/ext.big-id.base";

export class BigIdIntroSchema extends OwnerBigIdSchema implements ExtBigIdTuple, ExtIntro {
  @Column({ transformer: new TransformerVarchar50(), type: "varchar", nullable: false, length: 50 })
  name: VARCHAR50_PG = "";

  @Column({ transformer: new TransformerVarchar255(), type: "varchar", nullable: false, length: 255 })
  desc: VARCHAR255_PG = "";

  @Column({ transformer: new TransformerVarchar255(), type: "varchar", nullable: false, length: 255 })
  content: VARCHAR255_PG = "";

  @Column({ transformer: new TransformerVarchar255(), type: "varchar", nullable: false, length: 255 })
  remark: VARCHAR255_PG = "";

  @Column({ transformer: new TransformerSmallInt(), type: "smallint", nullable: false })
  sequence: SMALLINT_PG = -1;
}
